Class com.symantec.itools.vcafe.openapi.VisualProject
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.symantec.itools.vcafe.openapi.VisualProject

Object
   |
   +----com.symantec.itools.vcafe.openapi.VisualProject

public abstract class VisualProject
extends Object
The API used to represent and access a Visual Cafe project. To get a VisualProject to work with, use one of the following VisualCafe methods: The implementation of all of VisualProject's abstract methods first calls checkValidity(). Any method could therefore throw an InvalidVisualProjectException. This exception extends RuntimeException, so doesn't have to be explicity declared or caught. A VisualProject can become invalid if it is closed, and the corresponding ProjectListener message is ignored, for example.

Version:
1.0
Author:
Symantec Internet Tools Division
Since:
VCafe 3.0
See Also:
VisualCafe, getProjects, getTargetProject, getProject, openProject, createProject, createEmptyProject, createDefaultProject

Class Index

 o com.symantec.itools.vcafe.openapi.VisualProject. ProjectInputStream
ObjectInputStream with getProject() method for streaming in objects that require a project to instantiate themselves.

Variable Index

 o ENABLE_RAD_DEFAULT
An addFile "enableRAD" value indicating the file should added with RAD set to the default value for the project.
 o ENABLE_RAD_OFF
An addFile "enableRAD" value indicating the file should added with RAD disabled.
 o ENABLE_RAD_ON
An addFile "enableRAD" value indicating the file should added with RAD enabled.
 o FILES_TAB
Indicates the "Files" tab is selected in the project window.
 o OBJECTS_TAB
Indicates the "Objects" tab is selected in the project window.
 o PACKAGES_TAB
Indicates the "Packages" tab is selected in the project window.
 o UPDATE_PROJECT_BEANS_ASK
An addFile "updateProjectBeans" value indicating that after the file is added, the user should be prompted about updating project beans.
 o UPDATE_PROJECT_BEANS_NO
An addFile "updateProjectBeans" value indicating that after the file is added, project beans should be NOT be updated.
 o UPDATE_PROJECT_BEANS_YES
An addFile "updateProjectBeans" value indicating that after the file is added, project beans should be updated.

Constructor Index

 o com.symantec.itools.vcafe.openapi.VisualProject()

Method Index

 o aboutToChangeProjectEntries()
This method triggers the aboutToChangeProjectEntries() message to be sent to all ProjectListeners registered to this project.
 o addDTListener(DTListener)
Add a DTListener to this project.
 o addFile(File)
Adds a [relative, ProjectFile.USER_ADDED, ENABLE_RAD_DEFAULT, UPDATE_PROJECT_BEANS_NO] file to this VisualProject.
 o addFile(String, boolean, int, int)
Adds a [ProjectFile.USER_ADDED] file to this VisualProject.
 o addFile(String, int, boolean)
Adds a [ENABLE_RAD_DEFAULT, UPDATE_PROJECT_BEANS_NO] file to this VisualProject.
 o addProjectListener(ProjectListener)
Add a listener to this project.
 o checkValidity()
Checks that this VisualProject corresponds to a valid project in Visual Cafe.
 o close()
Closes this VisualProject.
 o createFile(String, String, int)
Creates a file in this VisualProject.
 o createFile(String, byte[], int)
Creates a file in this VisualProject.
 o createNewInteraction(VisualObject, VisualObject)
Creates a new interaction and opens an editor to edit it.
 o createNewInteraction(VisualObject, VisualObject, boolean)
Create a new interaction and open an editor to edit it.
 o doneChangingProjectEntries()
This method triggers the doneChangingProjectEntries() message to be sent to all ProjectListeners registered to this project.
 o execute()
Builds the project and runs the resulting program.
 o getAttributes()
Get the Attributes object that allows project-related named value storage.
 o getBuildManager()
Gets the class that allows access to this project's build commands.
 o getClassLoader()
Gets the ClassLoader for objects/classes in this project.
 o getDTClassObject(String)
Gets the Design-Time Reflection DTClass object associated with the class with the given string name.
 o getDocumentBase()
Gets the built project's document base.
 o getFile()
Gets the File associated with this VisualProject file.
 o getObjectLibrary()
Gets the class that allows access to this project's VisualObjects.
 o getOptionSet()
Gets this project's options.
 o getProjectFile(String)
Gets a ProjectFile that corresponds to the file with the given name.
 o getProjectFile(int)
Gets a ProjectFile that corresponds to the file id.
 o getProjectFiles()
Gets all of the files in this project.
 o getProjectFiles(int)
Gets all of the files in this project added by the specified source.
 o getProjectName()
Gets the name of the project.
 o getProjectType()
Gets this project's 'type'.
 o getSelectedFiles()
Get a list of the selected files in this project window.
 o getSelectedObjects()
Gets a list of the selected objects in this project window.
 o getSelectedTab()
Determines which tab is selected in the project window.
 o isValid()
Determines if this VisualProject corresponds to a valid project in Visual Cafe.
 o parseOutstandingFiles()
Parses the files in the project.
 o removeDTListener(DTListener)
Remove a DTListener from this project.
 o removeFile(ProjectFile)
Removes a ProjectFile from this project.
 o removeFile(File)
Removes a ProjectFile from this project.
 o removeProjectListener(ProjectListener)
Remove a listener from this project.
 o renameFile(ProjectFile, String, boolean)
Renames a file in this project.
 o resumeBackgroundParser(boolean)
Tells the project that it can resume the background parsing of DTClass information.
 o runInDebugger()
Builds the project and runs the resulting program under the debugger.
 o save()
Saves this VisualProject.
 o saveAs(File)
Saves this VisualProject to a new name.
 o setModified()
Mark this VisualProject's contents modified.
 o setProjectType(int)
Sets this project's 'type'.
 o setSelectedTab(int)
Selects the tab in the project window.
 o suspendBackgroundParser(boolean)
Tells this project to suspend the background parsing of DTClass information.
 o toString()
Gets a String that represents this object.
 o updateProjectBeans()
Forces all of the project's local beans to be updated.

Variables

 o ENABLE_RAD_DEFAULT
public static final int ENABLE_RAD_DEFAULT
An addFile "enableRAD" value indicating the file should added with RAD set to the default value for the project.

See Also:
addFile(String, boolean, int, int)
 o ENABLE_RAD_OFF
public static final int ENABLE_RAD_OFF
An addFile "enableRAD" value indicating the file should added with RAD disabled.

See Also:
addFile(String, boolean, int, int)
 o ENABLE_RAD_ON
public static final int ENABLE_RAD_ON
An addFile "enableRAD" value indicating the file should added with RAD enabled.

See Also:
addFile(String, boolean, int, int)
 o FILES_TAB
public static final int FILES_TAB
Indicates the "Files" tab is selected in the project window.

See Also:
getSelectedTab
 o OBJECTS_TAB
public static final int OBJECTS_TAB
Indicates the "Objects" tab is selected in the project window.

See Also:
getSelectedTab
 o PACKAGES_TAB
public static final int PACKAGES_TAB
Indicates the "Packages" tab is selected in the project window.

See Also:
getSelectedTab
 o UPDATE_PROJECT_BEANS_ASK
public static final int UPDATE_PROJECT_BEANS_ASK
An addFile "updateProjectBeans" value indicating that after the file is added, the user should be prompted about updating project beans.

See Also:
addFile(String, boolean, int, int)
 o UPDATE_PROJECT_BEANS_NO
public static final int UPDATE_PROJECT_BEANS_NO
An addFile "updateProjectBeans" value indicating that after the file is added, project beans should be NOT be updated.

See Also:
addFile(String, boolean, int, int)
 o UPDATE_PROJECT_BEANS_YES
public static final int UPDATE_PROJECT_BEANS_YES
An addFile "updateProjectBeans" value indicating that after the file is added, project beans should be updated.

See Also:
addFile(String, boolean, int, int)

Constructors

 o VisualProject
public VisualProject()

Methods

 o aboutToChangeProjectEntries
public abstract void aboutToChangeProjectEntries()
This method triggers the aboutToChangeProjectEntries() message to be sent to all ProjectListeners registered to this project.

See Also:
aboutToChangeProjectEntries, doneChangingProjectEntries
 o addDTListener
public abstract void addDTListener(DTListener listener)
Add a DTListener to this project. Changes to this project's Design-Time Reflection classes are broadcast to the listeners registered with it. To be notified of changes, a plug-in implements the com.symantec.itools.vcafe.openapi.dtreflect.DTListener interface, then calls this method to place itself on the notification list. When this VisualProject's Design-Time Reflection information changes, the listener is called.

Parameters:
listener - the object that receives notifications
See Also:
removeDTListener, addDTListener, DTListener
 o addFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile addFile(File file)
Adds a [relative, ProjectFile.USER_ADDED, ENABLE_RAD_DEFAULT, UPDATE_PROJECT_BEANS_NO] file to this VisualProject.

Parameters:
file - file to be added.
Returns:
the resultant ProjectFile object.
Throws: IllegalArgumentException
if the file doesn't exist or is a diretory.
See Also:
ProjectFile
 o addFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile addFile(String fileName,
                                                                      boolean makeRelative,
                                                                      int enableRAD,
                                                                      int updateProjectBeans)
Adds a [ProjectFile.USER_ADDED] file to this VisualProject.

Parameters:
fileName - the name of the file to be added.
makeRelative - option to make the file relative to the project or not.
enableRAD - should RAD be turned on for this file. Can be one of ENABLE_RAD_ON, ENABLE_RAD_OFF or ENABLE_RAD_DEFAULT.
updateProjectBeans - should local beans be updated after this file is added. Can be one of UPDATE_PROJECT_BEANS_YES, UPDATE_PROJECT_BEANS_NO, or UPDATE_PROJECT_BEANS_ASK.
Returns:
the resultant ProjectFile object.
Throws: IllegalArgumentException
if the file doesn't exist or is a diretory.
See Also:
ProjectFile
 o addFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile addFile(String fileName,
                                                                      int addedBy,
                                                                      boolean makeRelative)
Adds a [ENABLE_RAD_DEFAULT, UPDATE_PROJECT_BEANS_NO] file to this VisualProject.

Parameters:
fileName - name of the file to be added.
addedBy - who is adding this file.
makeRelative - option to make the file relative to the project or not.
Returns:
the resultant ProjectFile object.
Throws: IllegalArgumentException
if the file doesn't exist or is a diretory.
See Also:
ProjectFile
 o addProjectListener
public abstract void addProjectListener(ProjectListener projectListener)
Add a listener to this project. Changes to this project are broadcast to the listeners registered with it. To be notified of changes, a plug-in implements the ProjectListener interface, then calls this method to place itself on the notification list. When this VisualProject changes, the appropriate listener method is called.

Parameters:
listener - the object that receives notifications of changes to this project.
See Also:
ProjectListener, removeProjectListener
 o checkValidity
public void checkValidity() throws InvalidVisualProjectException
Checks that this VisualProject corresponds to a valid project in Visual Cafe. Note that the implementation of all of VisualProject's abstract methods first call checkValidity(). Any method could therefore throw an InvalidVisualProjectException.

Throws: InvalidVisualProjectException
when the VisualProject has been closed, for example.
 o close
public abstract void close()
Closes this VisualProject.

 o createFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile createFile(String fileName,
                                                                         String contents,
                                                                         int enableRAD)
Creates a file in this VisualProject. The file will be created relative to the project's location.

Parameters:
fileName - the name of the new ProjectFile.
contents - the text contents to put in this file.
enableRAD - should RAD be turned on for this file.
Returns:
the resultant ProjectFile object.
See Also:
ProjectFile
 o createFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile createFile(String fileName,
                                                                         byte contents,
                                                                         int enableRAD)
Creates a file in this VisualProject. The file will be created relative to the project's location.

Parameters:
fileName - the name of the new ProjectFile.
contents - the binary contents to put in this file.
enableRAD - should RAD be turned on for this file.
Returns:
the resultant ProjectFile object.
See Also:
ProjectFile
 o createNewInteraction
public abstract void createNewInteraction(VisualObject from,
                                          VisualObject to)
Creates a new interaction and opens an editor to edit it.

The method returns before editing begins. There is no guarantee that an interaction involving the objects specified will result, e.g., the user may cancel the interaction or specify other from and to objects. If called while the wizard is running (not likely because the wizard is modal, but possible) the wizard will queue the request to be performed after the current session is completed.

Parameters:
from - the VisualObject that fires the event; must not be null.
to - the VisualObject that is affected by the interaction; may be null.
 o createNewInteraction
public abstract void createNewInteraction(VisualObject from,
                                          VisualObject to,
                                          boolean useEditor)
Create a new interaction and open an editor to edit it.

Same as above except sets the interaction editor preference based on the preferEditor argument. The editor preference applies to all subsequent createNewInteraction calls without the third argument, in any project.

Parameters:
from - the VisualObject that fires the event; must not be null.
to - the VisualObject that is affected by the interaction; may be null.
useEditor - true if the interaction editor is to be used, false if the interaction wizard is to be used.
 o doneChangingProjectEntries
public abstract void doneChangingProjectEntries()
This method triggers the doneChangingProjectEntries() message to be sent to all ProjectListeners registered to this project.

See Also:
doneChangingProjectEntries, aboutToChangeProjectEntries
 o execute
public abstract void execute()
Builds the project and runs the resulting program. The debugger is not used to run the program.

See Also:
build
 o getAttributes
public abstract com.symantec.itools.vcafe.openapi.Attributes getAttributes()
Get the Attributes object that allows project-related named value storage. The values stored in the returned Attributes object are assoicated with this specific VisualProject, not with the Visual Cafe program in general. To create global name values (not specific to any one project), use VisualCafe's getAttributes method.

Returns:
this project's Attributes storage object.
See Also:
VisualProject.ProjectInputStream, Attributes
 o getBuildManager
public abstract com.symantec.itools.vcafe.openapi.BuildManager getBuildManager()
Gets the class that allows access to this project's build commands.

Returns:
this project's BuildManager
See Also:
BuildManager
 o getClassLoader
public abstract java.lang.ClassLoader getClassLoader()
Gets the ClassLoader for objects/classes in this project.

Returns:
this project's ClassLoader.
 o getDTClassObject
public abstract com.symantec.itools.vcafe.openapi.dtreflect.DTClass getDTClassObject(String className)
Gets the Design-Time Reflection DTClass object associated with the class with the given string name.

Parameters:
className - the name of a class in the project to find a design-time reflection class for.
Returns:
a DTClass object for the class.
 o getDocumentBase
public abstract java.net.URL getDocumentBase() throws MalformedURLException
Gets the built project's document base.

Returns:
the document base for this project's executable.
 o getFile
public abstract java.io.File getFile()
Gets the File associated with this VisualProject file.

Returns:
this VisualProject's File.
 o getObjectLibrary
public abstract com.symantec.itools.vcafe.openapi.VisualRepository getObjectLibrary()
Gets the class that allows access to this project's VisualObjects.

Returns:
this project's object library
See Also:
VisualRepository
 o getOptionSet
public abstract com.symantec.itools.vcafe.openapi.options.ProjectOptionSet getOptionSet()
Gets this project's options. The returned ProjectOptionSet allows access to the options for this project.

Returns:
the project's options.
See Also:
ProjectOptionSet
 o getProjectFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile getProjectFile(String fileName)
Gets a ProjectFile that corresponds to the file with the given name. If the file isn't in this project, null is returned.

Parameters:
fileName - the name of the desired file.
Returns:
a ProjectFile object, or null if not found.
See Also:
getProjectFiles(), getProjectFile(int), ProjectFile
 o getProjectFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile getProjectFile(int projectFileID)
Gets a ProjectFile that corresponds to the file id. If the file isn't in this project, null is returned.

Parameters:
projectFileId - the id of the desired file.
Returns:
a ProjectFile object, or null if not found.
See Also:
getProjectFiles(), getProjectFile(String), ProjectFile
 o getProjectFiles
public abstract com.symantec.itools.vcafe.openapi.ProjectFile[] getProjectFiles()
Gets all of the files in this project. An array is returned containing all of the files. If there are no files in the project, a zero-length array is returned.

Returns:
array of ProjectFile objects
See Also:
getProjectFiles(int), getProjectFile(String), getProjectFile(int), ProjectFile
 o getProjectFiles
public abstract com.symantec.itools.vcafe.openapi.ProjectFile[] getProjectFiles(int addedBy)
Gets all of the files in this project added by the specified source. An array is returned containing all of the added files. If there are no files, a zero-length array is returned.

Parameters:
addedBy - the source that added the file to the project, is a mask containing any of:
  • USER_ADDED - files added by the user.
  • COMPILER_ADDED - files added by the compiler.
  • PARSER_ADDED - files added by the parser.
  • UNKNOWN_ADDED - files added by an unknown source.
  • SHARED_DATABASE_ADDED - files added by the database.
  • ALL_FILE_ADDED - files added by any source.
Returns:
array of ProjectFile objects
See Also:
getProjectFiles(), getProjectFile(String), getProjectFile(int), ProjectFile, getFileAddedBy
 o getProjectName
public abstract java.lang.String getProjectName()
Gets the name of the project.

Returns:
name of the project.
 o getProjectType
public abstract int getProjectType()
Gets this project's 'type'. More specific than the project's target type.

Returns:
the project's type.
See Also:
ProjectTemplateInterface;, getTargetType
 o getSelectedFiles
public abstract com.symantec.itools.vcafe.openapi.ProjectFile[] getSelectedFiles()
Get a list of the selected files in this project window. If no files are selected a zero-length array is returned.

Returns:
an array of selected ProjectFile objects.
 o getSelectedObjects
public abstract com.symantec.itools.vcafe.openapi.VisualObject[] getSelectedObjects()
Gets a list of the selected objects in this project window. If no objects are selected a zero-length array is returned.

Returns:
an array of selected VisualObject objects.
 o getSelectedTab
public abstract int getSelectedTab()
Determines which tab is selected in the project window.

Returns:
an integer that identifies the selected tab, one of:
  • OBJECTS_TAB - the "Objects" tab is selected,
  • PACKAGES_TAB - the "Packages" tab is selected, or
  • FILES_TAB - the "Files" tab is selected
See Also:
setSelectedTab
 o isValid
public abstract boolean isValid()
Determines if this VisualProject corresponds to a valid project in Visual Cafe.

Returns:
true if so, false otherwise.
See Also:
checkValidity
 o parseOutstandingFiles
public abstract void parseOutstandingFiles()
Parses the files in the project. Only outdated files are parsed. This causes the project's Design-Time Reflection classes to be updated.

 o removeDTListener
public abstract void removeDTListener(DTListener listener)
Remove a DTListener from this project. Stops the listener from receiving notifications of changes to this project's Design-Time Reflection classes.

Parameters:
listener - the object that was receiving notifications
See Also:
addDTListener, removeDTListener, DTListener
 o removeFile
public abstract void removeFile(ProjectFile file)
Removes a ProjectFile from this project.

Parameters:
file - the ProjectFile to remove.
See Also:
ProjectFile
 o removeFile
public abstract void removeFile(File file)
Removes a ProjectFile from this project.

Parameters:
file - the File to remove.
Throws: IllegalArgumentException
if the file doesn't exist, is a directory, or isn't part of this project.
 o removeProjectListener
public abstract void removeProjectListener(ProjectListener projectListener)
Remove a listener from this project. Stops the listener from receiving notifications of changes to this project.

Parameters:
listener - the object that was receiving notifications.
See Also:
ProjectListener, addProjectListener
 o renameFile
public abstract void renameFile(ProjectFile file,
                                String newName,
                                boolean replace)
Renames a file in this project. The new file name must be fully qualified. This method optionally overwrites any existing file with the same new name. The old file with the original name is deleted.

Parameters:
file - the ProjectFile that will be renamed.
newName - the new fully qualified name for this file.
replace - true to overwrite any file that might already have the new name.
 o resumeBackgroundParser
public abstract void resumeBackgroundParser(boolean bringUpToDate)
Tells the project that it can resume the background parsing of DTClass information.

Parameters:
bringUpToDate - if true, update the DTClass information.
 o runInDebugger
public abstract void runInDebugger()
Builds the project and runs the resulting program under the debugger.

See Also:
build
 o save
public abstract void save()
Saves this VisualProject.

 o saveAs
public abstract void saveAs(File newFile)
Saves this VisualProject to a new name.

Parameters:
newFile - where to save this VisualProject.
 o setModified
public abstract void setModified()
Mark this VisualProject's contents modified. This can be useful if you save persistent attributes in response to ProjectListener.aboutToSaveProject().

See Also:
aboutToSaveProject
 o setProjectType
public abstract void setProjectType(int projectType)
Sets this project's 'type'. More specific than the project's target type. The Target Type is updated in all of the project's option sets (Debug and Final).

Parameters:
projectType - the project's new type.
See Also:
ProjectTemplateInterface;, getTargetType
 o setSelectedTab
public abstract void setSelectedTab(int selectedTab)
Selects the tab in the project window.

Parameters:
selectedTab - an integer that identifies the selected tab, one of:
  • OBJECTS_TAB - the "Objects" tab is selected,
  • PACKAGES_TAB - the "Packages" tab is selected, or
  • FILES_TAB - the "Files" tab is selected
See Also:
getSelectedTab
 o suspendBackgroundParser
public abstract void suspendBackgroundParser(boolean bringUpToDate)
Tells this project to suspend the background parsing of DTClass information.

Parameters:
bringUpToDate - if true, make sure the state of the DTClass information is brought up to date before suspending the parser. This method must be matched by a call to resumeBackgroundParser(). example usage: visualProject.suspendBackgroundParser(false); try { ... ... lots of processing here that causes parsing ... ... } finally { visualProject.resumeBackgroundParser(true); }
 o toString
public java.lang.String toString()
Gets a String that represents this object.

Returns:
the String,
Overrides:
toString in class Object
 o updateProjectBeans
public abstract void updateProjectBeans()
Forces all of the project's local beans to be updated.


All Packages  Class Hierarchy  This Package  Previous  Next  Index